package org.shnux.android.bingo;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.graphics.Typeface;
import android.graphics.drawable.AnimationDrawable;
import android.os.Bundle;
import android.os.Handler;


import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.Button;
import android.widget.ImageView;

public class BingoActivity extends Activity {
	AnimationDrawable frameAnimation;
	Context context;


    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.bingo);

        Button bback = (Button) findViewById(R.id.bingoBack); 
  
      	Typeface font = Typeface.createFromAsset(getAssets(), "good.ttf");  
        bback.setTypeface(font); 

        

    	
    }
   

    public void  onWindowFocusChanged  (boolean hasFocus){
    	if (hasFocus)
        {
    		 ImageView img = (ImageView)findViewById(R.id.bingo_anim);
    		 frameAnimation =    (AnimationDrawable)img.getDrawable();
    		 frameAnimation.setCallback(img);
    		 frameAnimation.setVisible(true, true);
    		 frameAnimation.start();

        }
        else
        {   
        	frameAnimation.stop();
        }

  }
 
    
    
    
    public void onBackPressed() {
  	  
  	  this.finish();
        Intent intent = new Intent(getApplicationContext(), MenuActivity.class);         
    	  startActivity(intent);
    	
  	  overridePendingTransition(R.anim.moveout, R.anim.moveout);
  	}
 
  public void onBackPressed(View v) {
	  
	  this.finish();
      Intent intent = new Intent(getApplicationContext(), GameActivity.class);         
  	  startActivity(intent);
  	
	  
	}
  
  
  
    
    
    
    
    
}